__slots__ (Python データモデル)
訳語は「スロット」?
__slots__ allow us to explicitly declare data members (like properties) and deny the creation of __dict__ and __weakref__
「(プロパティのような)データメンバを明白に宣言できる」
「__dict__や__weakref__を作成させない」
__dict__ を使うのに比べて、節約できるメモリ空間はかなり大きいです。 属性探索のスピードもかなり向上できます。
This class variable can be assigned a string, iterable, or sequence of strings with variable names used by instances.
「文字列、イテラブル、または(すなわち?)インスタンスによって使われる変数名の文字列のシーケンスを代入できる」
__slots__を利用する際の注意点あり(TODO)
Python 3.10から@dataclassが対応